package com.younker.waf.html;

import java.net.URL;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
import java.io.IOException;

public class OptionsConfig {

	private static PropertyResourceBundle RESOURCE_BUNDLE = null;

	private OptionsConfig() {
	}

	public static void init(URL url) throws IOException {
		RESOURCE_BUNDLE = new PropertyResourceBundle(url.openStream());
	}

	public static String getString(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}
}
